<template>
  <div class="page">
    <CommonList :requestUrl="requestUrl" :columns="columns" :queryFormItems="queryFormItems">
      <template v-slot:type>
        <el-table-column prop="type" label="类型" align="center" min-width="50">
          <template #default="{ row }">
            <el-tag effect="dark">{{ _options.getVal('error_type', row.type) }}</el-tag>
          </template>
        </el-table-column>
      </template>
      <template v-slot:status>
        <el-table-column prop="type" label="状态" align="center" min-width="50">
          <template #default="{ row }">
            <el-tag effect="dark">{{ _options.getVal('error_status', row.status) }}</el-tag>
          </template>
        </el-table-column>
      </template>
    </CommonList>
  </div>
</template>
<script lang="ts" setup>
import CommonList from '@/components/CommonList.vue'
import { inject } from 'vue'

const _options: any = inject('_options')

const requestUrl = 'sentenceError'

const columns = [
  { prop: 'content', label: '内容' },
  { prop: 'eid', label: '错误标识', width: '50' },
  { prop: 'type', label: '类型', slot: 'type' },
  { prop: 'status', label: '状态', slot: 'status' },
  { prop: 'nickname', label: '提交用户', width: '50' },
  { prop: 'create_time', label: '提交时间' }
]
const queryFormItems = [{ prop: 'content', label: '内容' }]
</script>
